﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SocialPlatformSDK.Model;
using SocialPlatformSDK.Services;
using SocialPlatformSDK.Services.Util;
using SocialPlatformSDK.Util;

namespace SocialPlatformSDK
{
    public class TencentSocFactory : SocialFactoryBase<TencentSocFactory>
    {
        private IOAuthConfigruation _tencentOAuthConfig;
        private TencentAPIService<TencentServiceArgument> _tencentAPIService;
        public  void Init()
        {
            _tencentOAuthConfig = TencentOAuthInfo.Instance;
            _tencentOAuthConfig.Init();          
            _tencentAPIService = new TencentAPIService<TencentServiceArgument>(_tencentOAuthConfig.AccessToken, _tencentOAuthConfig);

        }
        public override void Validate()
        {

            _tencentOAuthConfig.Validate();
        }

        public override void ClearAccessToken()
        {
            _tencentOAuthConfig.ClearAccessToken();
        }

        public override void SaveData(AccessToken token)
        {
            _tencentOAuthConfig.TokenIso.SaveData(token);
        }

        public override void SocialSharePublish(string channelName, string channelUrl, string message, SocialShareHandler callBack)
        {
            throw new NotImplementedException();
        }

        public TencentAPIService<TencentServiceArgument> GetAPIService()
        {
            _tencentAPIService = new TencentAPIService<TencentServiceArgument>(_tencentOAuthConfig.AccessToken, _tencentOAuthConfig);
            return _tencentAPIService;
        }
    }
}
